package com.alit.ibot.manager.attachement.controller;

import com.alit.ibot.manager.attachement.data.IdUrlData;
import com.alit.ibot.manager.attachement.service.UrlManagerService;
import com.jfinal.aop.Inject;
import com.jfinal.core.Controller;

/**
 * @author litong
 * @date 2019年6月20日_下午5:34:59
 * @version 1.0
 * @desc
 */
public class AttachmentURLManager extends Controller {
  @Inject
  private UrlManagerService ums;

  public void list(int page, int rows) {
    renderJson(ums.paginate(page, rows));
  }

  public void update(Integer id,String url) {
    renderJson(ums.update(new IdUrlData(id,url)));
  }

  public void save(IdUrlData data) {
    renderJson(ums.update(data));
  }
  
  public void destroy(Integer id) {
    renderJson(ums.destory(id));
  }
}
